/**Doctors orders presenter**/
// $codepro.audit.disable assignmentToNonFinalStatic, largeNumberOfParameters
package edu.gatech.presenters;

import javax.swing.JOptionPane;

import edu.gatech.datastorage.DoctorsOrders;
import edu.gatech.datastorage.Prescription;
import edu.gatech.userclasses.Doctor;
import edu.gatech.userclasses.Patient;

/** Makes a doctors order from the GUI
 * 
 * @author Tyler Natoli
 * @version 1.0
 */
public class DoctorsOrdersPresenter {
	
	/**Doctor that is adding the order**/
	private final Doctor currentDoctor;
	
	/**Patient whose treatment record is being used**/
	private final Patient currentPatient;
	
	/**Constructor that gets the doctor and patient
	 * from the GUI
	 * @param currentDoctor
	 * @param currentPatient
	 */
	public DoctorsOrdersPresenter(Doctor currentDoctor, Patient currentPatient){
		this.currentDoctor = currentDoctor;
		this.currentPatient = currentPatient;
	}
	
	/**Adds doctors orders to the patients record
	 * 
	 * @param medicine
	 * @param frequency
	 * @param labWork
	 * @param followUpInfo
	 * @param other
	 * @param followUp
	 */
	public void addOrders(String medicine, String frequency, String labWork, 
			String followUpInfo, String other, boolean followUp){
		final Prescription pres = new Prescription(medicine, frequency);
		final DoctorsOrders doc = new DoctorsOrders(pres, labWork, followUpInfo, other);
		currentDoctor.addOrders(currentPatient, doc, followUp);
		JOptionPane.showMessageDialog(null, "Orders added!");
	}
	
	/** Overrides toString
	 * @return String
	 */
	public String toString(){
		return "Doctors orders presenter";
	}
}
